package com.free.framework.lib.utils;

import in.srain.cube.views.ptr.PtrFrameLayout;
import in.srain.cube.views.ptr.header.MaterialHeader;

/**
 * @author 李炳南
 * @date 2017/1/9
 */
public class PtrUtils {


    public static void initPtr(final PtrFrameLayout ptrFrameLayout) {

        MaterialHeader header = new MaterialHeader(ptrFrameLayout.getContext());

        int vPadding = Dp2Px.dip2px(ptrFrameLayout.getContext(), 10f);

        header.setPadding(0, vPadding, 0, vPadding);
        ptrFrameLayout.setDurationToCloseHeader(1500);
        ptrFrameLayout.setHeaderView(header);
        ptrFrameLayout.addPtrUIHandler(header);

        ptrFrameLayout.setLoadingMinTime(3000);
    }


}
